<script setup>
import { ref, onMounted } from 'vue';
import FanPullRefresh from '..';

const num = ref(0);

onMounted(() => {
  const nav = document.querySelector('.demo-nav');
  nav && (nav.style.display = 'none');
});

const onRefresh = (stopPullRefresh) => {
  setTimeout(() => {
    num.value++;
    stopPullRefresh();
  }, 1000);
};
</script>

<template>
  <div style="background-color: red; height: 30vh"></div>
  <FanPullRefresh @refresh="onRefresh">
    <div style="height: 500vh">刷新次数：{{ num }}</div>
  </FanPullRefresh>
</template>
